let array = [-2, -4, 8, 9, 0, 1];

let sort = (array, left, right) => {
    // 
    if (left >= right) {
        return
    }
    let jizhun = array[left]
    let l = left
    let r = right
    while (l < r) {
        while (l < r && jizhun <= array[r]) {
            r--;
        }
        while (l < r && jizhun >= array[l]) {
            l++;
        }
        if (l < r) {
            let temp = array[l]
            array[l] = array[r]
            array[r] = temp
        }
    }
    if (jizhun > array[l]) {
        array[left] = array[l]
        array[l] = jizhun
    }
    sort(array, left, l - 1)
    sort(array, l + 1, right)
}
// 调用方法:方法名(实参列表);
sort(array, 0, array.length - 1)
console.log(array);